package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Title    string `gorm:"type:varchar(30)" json:"title"`
	Context  string `gorm:"type:varchar(30)" json:"context"`
	Username string `gorm:"type:varchar(30)" json:"username"`
}

func (u *User) UserAdd(db *gorm.DB, context string) error {
	return db.Where("context=?", context).Error
}
